#include <iostream>
#include <stdlib.h>
#include <assert.h>
using namespace std;
typedef int BTDateType;
typedef struct BinaryTreeNode
{
	int date;
	BinaryTreeNode* left;
	BinaryTreeNode* right;
}BTNode;
BTNode* BuyNode(BTDateType x)
{
	BTNode* node = (BTNode*)malloc(sizeof(BTNode));
	if (node == NULL)
	{
		perror("malloc fail");
		return NULL;
	}
	node->date = x;
	node->left = NULL;
	node->right = NULL;
	return node;
}
BTNode* Create()
{
	BTNode* node1 = BuyNode(1);
	BTNode* node2 = BuyNode(2);
	BTNode* node3 = BuyNode(3);
	BTNode* node4 = BuyNode(4);
	BTNode* node5 = BuyNode(5);
	BTNode* node6 = BuyNode(6);
	node1->left = node2;
	node2->left = node3;
	node1->right = node4;
	node4->left = node5;
	node4->right = node6;
	return node1;

}
void PreOrder(BTNode* root)
{
	if (root==NULL)
	{
		printf("NULL ");
		return;
	}

	printf("%d ",root->date);
	PreOrder(root->left);
	PreOrder(root->right);

}

int main()
{
	BTNode* root=Create();
	PreOrder(root);
	printf("\n");
}